# windowMixin
from Module.MainWindow.Splash import *

class WindowMixin(object):

    def menu(self, title, actions=None):
        # self.setStyleSheet("QMenuBar:rgb(0,80,255)")
        menu = self.menuBar().addMenu(title)

        if actions:
            addActions(menu, actions)
        return menu

    def toolbar(self, title, actions=None, toolBarOritation = Qt.TopToolBarArea):#界面功能按键
        toolbar = ToolBar(title)
        toolbar.setFont(QFont(FONTSTR,FONT_SIZE3))
        toolbar.setPalette(QPalette(QColor(61,161,191)))
        toolbar.setMinimumHeight(100)
        toolbar.setAutoFillBackground(True)
        toolbar.setObjectName(TOOL_BAR % title) # u'%sToolBar'
        toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        if actions:
            addActions(toolbar, actions)
        self.addToolBar(toolBarOritation, toolbar)
        return toolbar